<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="Bookmark" href="favicon.ico" >
    <link rel="Shortcut Icon" href="favicon.ico" />
    <!--[if lt IE 9]>
    <script type="text/javascript" src="lib/html5.js"></script>
    <script type="text/javascript" src="lib/respond.min.js"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="/h-ui/css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href="/h-ui.admin/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="lib/Hui-iconfont/1.0.8/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="/h-ui.admin/skin/default/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="/h-ui.admin/css/style.css" />
    <!--[if IE 6]>
    <script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
    <script>DD_belatedPNG.fix('*');</script><![endif]-->
    <!--/meta 作为公共模版分离出去-->

    <title>baby堂小儿推拿医疗管理系统</title>
    <meta name="keywords" >
    <meta name="description" >
</head>
<body>
<!--_header 作为公共模版分离出去-->
<div th:replace="head :: head"></div>
<!--/_header 作为公共模版分离出去-->

<!--_menu 作为公共模版分离出去-->
<div th:replace="menu :: menu"></div>
<!--/_menu 作为公共模版分离出去-->

<section class="Hui-article-box">
    <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 医生管理 <span class="c-gray en">&gt;</span> 医生信息<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);"  th:href="@{/DoctorInfo}" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
    <div class="Hui-article">
        <article class="cl pd-20">
            <div class="text-c">
                <form th:action="@{/checkSelct}" th:method="POST">
                    <input type="text" class="input-text" style="width:250px" placeholder="输入医生姓名、电话" id="" name="docInof">
                    <button type="submit" class="btn btn-success radius" id="" name=""><i class="Hui-iconfont">&#xe665;</i> 搜医生</button>
                </form>
            </div>
            <div class="mt-20">
                <table class="table table-border table-bordered table-hover table-bg table-sort">
                    <thead>
                    <tr class="text-c">
                        <th width="80">ID</th>
                        <th width="100">姓名</th>
                        <th width="40">性别</th>
                        <th width="90">年龄</th>
                        <th width="150">级别</th>
                        <th width="110">电话</th>
                        <th width="150">操作</th>

                    </tr>
                    </thead>
                    <form>

                    </form>
                    <tbody id="tt">
                    <tr class="text-c" th:each="d:${doctorInfos}">
                        <td th:text="${doctorInfos.indexOf(d) + 1}" >1</td>
                        <td  th:text="${d.id}" style="display: none" name="id" >1</td>
                       <td><u th:text="${d.dname}" style="cursor:pointer" class="text-primary" th:onclick="member_show([[${d.dname}]],[[@{/lookInfo(id=${d.id})}]]);">张三</u></td>
                        <td th:switch="${d.sex}">
                            <a th:case="0">女</a>
                            <a th:case="1">男</a>
                        </td>
                        <td th:text="${d.age}">23</td>
                        <td th:switch="${d.type}">
                            <a th:case="0">医师</a>
                            <a th:case="1">主治医师</a>
                            <a th:case="2">主任医师</a>
                        </td>
                        <td class="td-manage" th:text="${d.phone}"></td>
                        <td class="td-status">
                            <a class="label label-success radius" th:onclick="member_show([[${d.dname}]],[[@{/lookInfo(id=${d.id})}]]);">查看</a>
                            <a th:if="${session.roc} eq 1"><a class="label label-danger radius"  th:onclick="deleteDoctor([[${d.id}]]);" >删除</a></a>

                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </article>
    </div>
</section>

<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="/h-ui/js/H-ui.js"></script>
<script type="text/javascript" src="/h-ui.admin/js/H-ui.admin.page.js"></script>
<!--/_footer /作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript">

    /*用户-查看*/
    function member_show(title,url){
         layer_show(title,url,"1000","450");
    }
    /*删除医生信息*/
    function deleteDoctor(id){
            $.ajax({
                type: 'POST',
                url: '/deleteDoctor',
                dataType: 'json',
                data:{id:id},
                success: function(data){
                    if(data.status==200){
                        layer.msg('已删除!',{icon:1,time:1000});
                        window.setTimeout("window.location='/DoctorInfo'",1000);
                    }
                },
                error:function(data) {
                    layer.msg('删除失败!');
                },
            });
    }

    /*用户-停用*/
    function member_stop(obj,id){
        layer.confirm('确认要下班吗？',function(index){
            $(obj).parents("tr").find(".td-manage").prepend('<a style="text-decoration:none" onClick="member_start(this,id)" href="javascript:;" title="下班"><i class="Hui-iconfont">&#xe6e1;</i></a>');
            $(obj).parents("tr").find(".td-status").html('<span class="label label-defaunt radius">未上班</span>');
            $(obj).remove();
            layer.msg('已下班!',{icon: 5,time:1000});
        });
    }

    /*用户-启用*/
    function member_start(obj,id){
        layer.confirm('确认要上班吗？',function(index){
            $(obj).parents("tr").find(".td-manage").prepend('<a style="text-decoration:none" onClick="member_stop(this,id)" href="javascript:;" title="上班"><i class="Hui-iconfont">&#xe631;</i></a>');
            $(obj).parents("tr").find(".td-status").html('<span class="label label-success radius">上班</span>');
            $(obj).remove();
            layer.msg('已上班!',{icon: 6,time:1000});
        });
    }



</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>